/*
 *      Newton Developer Technical Support Sample Code
 *
 *      TestEnabler
 *
 *      by Jason Rukman
 *
 *      Copyright  1996 by Apple Computer, Inc.  All rights reserved.
 *
 *      You may incorporate this sample code into your applications without
 *      restriction.  This sample code has been provided "AS IS" and the
 *      responsibility for its operation is 100% yours.  You are not
 *      permitted to modify and redistribute the source as "DTS Sample Code."
 *      If you are going to re-distribute the source, we require that you
 *      make it clear in the source that the code was descended from
 *      Apple-provided sample code, but that you've made changes.
*/

SetPartFrameSlot( 'TestEnabler, GetLayout("TestEnabler") );

InstallScript := func( partFrame, removeFrame ) 
	begin
		call kRegMsgModuleFunc with ( kAppSymbol, partFrame.testEnabler );
	end;


RemoveScript := func( removeFrame )
	begin
		call kUnRegMsgModuleFunc with ( kAppSymbol );
	end;
	
SetPartFrameSlot( 'DeletionScript, func() 
	begin
		call kDeleteMsgModuleFunc with ( kAppSymbol );
	end
				);
				
SetPartFrameSlot( 'DoNotInstall, func() 
	begin
		// Don't install this module if the user has selected to save packages on a card.
		// We must install this internally so that the remove script in the module gets
		// called correctly.
		if GetStores()[0] <> GetVBOStore( ObjectPkgRef('foo) ) then begin
			GetRoot():Notify( kNotifyAlert, kAppName, "Sorry, you must install this package on the internal memory." );
			return true;
		end;
		
		nil;
	end );				